/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package sda.levelup.telnet;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Дима
 */
public class ChatTest
{
    public static void main(String[] args) {
        try {
            int i = 1;
            ServerSocket s = new ServerSocket(8189);
            
            while(true){
                Socket incoming = s.accept();
                System.out.println("Spawning "+i);
                Runnable r = new ChatRunnable(incoming, i);
                Thread th = new Thread(r);
                th.start();
                i++;
            }
        }
        catch (IOException ex) {
            ex.printStackTrace();
        }
    }
}
